package com.kxc.dao;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import com.kxc.entity.MoniPoint;

/**
 * 设备管理 数据层
 * 
 * @author ruoyi
 */
public interface MoniPointDao extends JpaRepository<MoniPoint,Long>,JpaSpecificationExecutor<MoniPoint> {
      
	public Page<MoniPoint> findAll(Specification<MoniPoint> specification, Pageable pageable);

	public MoniPoint findByPointNum(String pointNum);
	@Transactional
	public int deleteByPointNum(String pointNum);
	
	@Transactional
	@Modifying
	@Query("update monipoint m set m.x=?1,m.y=?2 where  m.pointNum=?3")
	public int updatePosition(String x,String y,String pointNum);

	public List<MoniPoint> findByMoniItem(String itemNum);

	public MoniPoint findByMoniItemAndDev(String item, String devNum);
}
